<template>
	<view id="app">
		<view>
			<RainRecord @myClick="myClick" :newlist="newlist"></RainRecord>
		</view>
	</view>
</template>
<script>
	import RainRecord from '@/components/water/RainInfo/index.vue';
	import { getRainInfo } from '../api/api.js'
	export default {
		data() {
			return {
				newlist:[],
			}
		},
		onLoad(options) {
		},
		components: {
			RainRecord
		},
		mounted() {
			this.search()
		},
		methods: {
			myClick(stcd,stnm) {
				//跳转到页面
				uni.navigateTo({
					url: '../rainDZ?stcd=' + stcd+'&stnm='+stnm
				})
			},
			search() {
				var _data = {
					STIME: new Date(new Date().addDate("d",-1)).Format("YYYY-MM-DD 08:00:00"),
					ETIME: new Date(new Date().addDate("h",1)).Format("YYYY-MM-DD hh:00:00"),
					TREEID: "2021081401170261507"
				};
				var _param = {}
				_param.data = _data;
				getRainInfo(_param).then(res =>{
					console.log(res)
					this.newlist = res.data;
				})
				
			}
		}
	}
	
</script>

<style>
</style>
